home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm2 / szflw011.lha / SizeFlow / SizeFlow.rexx < prev   
OS/2 REXX Batch file  |  1996-05-08  |  887b  |  59 lines

  1. /*
  2.  
  3.                         $VER: SizeFlow 0.11  (08.05.96)
  4.  
  5.                             (C) 1996  Robert Hofmann
  6.  
  7.  
  8. */
  9.  
  10.  
  11. parse arg flow .
  12.  
  13.  
  14. call Include_Lib('rexxsupport')
  15. call pragma('W', 'NULL')
  16.  
  17.  
  18. if ~open(in, flow, r) then
  19.     do
  20.         say '*** ERROR: Unable to open "'flow'"!'
  21.         exit 20
  22.     end
  23.  
  24. files    = 0
  25. total    = 0
  26.  
  27. do while ~eof(in)
  28.     parse value statef(strip(readln(in), 'l', '-^#'))'0 0' with . size .
  29.     if size=0 then iterate
  30.  
  31.     files    = files+1
  32.     total    = total+size
  33. end
  34.  
  35. call close(in)
  36.  
  37. say flow': ' files 'Files =' total 'Bytes =' (total+512)%1024 'kB =' (((total+512)%1024)+512)%1024 'MB'
  38.  
  39. exit
  40.  
  41.  
  42.  
  43.  
  44. Include_Lib: procedure
  45.  
  46.     parse arg lib, prio
  47.     if right(upper(lib), 8)~='.LIBRARY' then lib    = lib'.library'
  48.     if prio=''                                                    then prio    = 0
  49.  
  50.     if ~show('l', lib) then
  51.         if ~addlib(lib, prio, -30, 0) then
  52.             do
  53.                 say '*** ERROR: Could not open' lib'!!! ***'
  54.                 exit 10
  55.             end
  56. return
  57.  
  58.  
  59.